<?php
class LogManager{

	public static function setLogs($todo){
		$sql = "INSERT INTO `log`(`todo`,`ipaddress`,`createdatetime`,`logtype`) VALUES(?, ?, now(), 0)";
		$sqlQuery = new SqlQuery($sql);
		$sqlQuery->set($todo);
		$sqlQuery->set(IPManager::getRealIpAddr());
		return QueryExecutor::executeInsert($sqlQuery);
	}
	
	public static function setErrLogs($todo){
		$sql = "INSERT INTO `log`(`todo`,`ipaddress`,`createdatetime`,`logtype`) VALUES(?, ?, now(), 1)";
		
		LogManager::setLogs(IPManager::getRealIpAddr());
		
		$sqlQuery = new SqlQuery($sql);
		$sqlQuery->set($todo);
		$sqlQuery->set(IPManager::getRealIpAddr());
		return QueryExecutor::executeInsert($sqlQuery);
	}
	
	
}
?>